package com.demo6.demo.core.controller;

import com.demo6.demo.core.entity.Student;
import com.demo6.demo.core.entity.TableDataInfo;
import com.demo6.demo.core.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * User: wangy
 * Date: 2020/6/11
 * Description: No Description
 */
@Controller
@RequestMapping("/studentManage")
public class StudentController extends BaseController {

    @Autowired
    StudentService studentService;

    @RequestMapping("/toStudentPage")
    public String toStudentPage(){
        return "student";
    }

    @RequestMapping("/studentAll")
    @ResponseBody
    public TableDataInfo studentAll(Student student){
    List<Student> students = studentService.studentAll(student);
    return  getDataTable(students);
    }
}
